﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChinessChess
{
    class CSi:CQuanCo
    {
        
        private int new_index, old_index;
        int[] white =new int[5] {3,5,13,21,23 };
        int[] black =new int[5] { 66, 68, 76, 84, 86 };
        public CSi():base() { 

        }
        public CSi(COCo[] chess, int newIndex, int oldIndex, ChessColor color)
            : base(chess,color){
            this.new_index = newIndex;
            this.old_index = oldIndex;
        }

       
        public override bool CheckIndex(){
            switch (Color) { 
                case ChessColor.white:{
                    if (white.Contains(new_index)) {
                        if (Math.Abs(new_index - old_index) == 10 || Math.Abs(new_index - old_index)==8) {
                            return true;
                        }
                    }
                    break;
                }
                case ChessColor.black:{
                    if (black.Contains(new_index)){
                        if (Math.Abs(new_index - old_index) == 10 || Math.Abs(new_index - old_index) == 8){
                            return true;
                        }
                    }
                        break;
                    }
            }
            return false;
        }
        public override bool CheckPoint(){
            return false;
        }
    }
}
